#ifndef THREAD_THREAD_H
#define THREAD_THERAD_H

#include <functional>
#include <string>
#include <thread>

class Thread {
public: 
    using ThreadFunc = std::function<void()>;

    explicit Thread(const ThreadFunc func, const std::string &name = {});
    ~Thread();

    void start();
    void join();

private:
    ThreadFunc _func;
    std::string _name;
    std::unique_ptr<std::thread> _thread;
    bool _started;
    bool _joined;
};


#endif